package com.dragon.refect.classload;

/**
 * 类的初始化的代码演示案例
 *
 * @author dragon
 * @since 2019/11/20
 */
public class MyTest5 {

    static {
        System.out.println("class MyTest block");
    }

    public static void main(String[] args) {
       Child.a();
    }
}


interface Parent1 {

    Thread THREAD = new Thread() {
        {
            System.out.println("interface Parent1 block");
        }
    };
}

abstract class Parent2 {

    public static int A = 10;

    static {
        System.out.println("abstract Parent2 block");
    }

    public static void a() {
        System.out.println("Parent2 static a()");
    }
}

class Child extends Parent2 implements Parent1 {

    public static int B = 20;

    static {
        System.out.println("class Child block");
    }
}


